package com.tsunade.spring6.resource;

import com.tsunade.spring6.config.SpringConfig;
import com.tsunade.spring6.resource.controller.UserController;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Project ：learn_spring
 * @File ：TestUserController.java
 * @IDE ：IntelliJ IDEA
 * @Author ：自由如风间
 * @Date ：2025/3/30 19:20
 * @Description ：For study.
 */

public class TestUserControllerAnno {

    public static void main(String[] args) {
        // ApplicationContext context = new
        //         ClassPathXmlApplicationContext("bean.xml");
        // 加载配置类
        ApplicationContext context = new AnnotationConfigApplicationContext(SpringConfig.class);
        UserController controller = context.getBean(UserController.class);
        controller.add();
    }
}
